﻿using SmartPlant.Model;
using SmartPlant.Model.Biz;
using SmartPlant.Model.DbContext.Biz;
using System.Collections.Generic;
using System.IO;
using System.Threading.Tasks;

namespace SmartPlant.Services.Interfaces
{
    /// <summary>
    /// 
    /// </summary>
    public interface IAchievementService
    {

        /// <summary>
        /// 导出仪表数据表。
        /// AchievementController/SpecOutput
        /// </summary>
        /// <param name="proId"></param>
        /// <param name="templatepath"></param>
        /// <param name="units"></param>
        /// <param name="insttypeids"></param>
        /// <param name="exportflag"></param>
        /// <param name="onlyOne"></param>
        /// <returns></returns>
        Task<RESTfulResult<string>> SpecOutputAsync(string proId, string templatepath, string units, string insttypeids, bool exportflag);

        /// <summary>
        /// 索引表导出。
        /// AchievementController/Index
        /// </summary>
        /// <param name="proId"></param>
        /// <param name="unitids"></param>
        /// <param name="templatepath"></param>
        /// <param name="templatename"></param>
        /// <param name="exportFlag"></param>
        /// <returns></returns>
        Task<RESTfulResult<string>> IndexTableOutputAsync(string proId, string unitids, string templatepath, string templatename, bool exportFlag);
        /// <summary>
        /// 规格书导出时，进行预览。
        /// AchievementController/SpecOutputPreview
        /// </summary>
        /// <param name="proId"></param>
        /// <param name="unitids"></param>
        /// <returns></returns>
        Task<List<ComponentFunctionType>> GetSpecOutputPreviewAsync(string proId, string unitids);

        /// <summary>
        /// 规格书导出时，模板的所有路径（因为规格书特殊，不是以某一个模板进行选择，而是以某几个作为整体）.
        /// AchievementController/SpecOutputTemplatePath
        /// </summary>
        /// <param name="proId"></param>
        /// <returns></returns>
        Task<List<string>> SpecOutputTemplatePath(string proId);

        /// <summary>
        /// 材料表导出。
        /// AchievementController/OutputBOM
        /// </summary>
        /// <param name="proId"></param>
        /// <param name="groupMode"></param>
        /// <param name="report"></param>
        /// <returns></returns>
        Task<RESTfulResult<Stream>> ExportItemListBomAsync(string proId, GroupMode groupMode, Report report);

        #region 模板背后的具体文件操作相关

        ///// <summary>
        ///// 创建，放到TemplateSetting
        ///// AchievementController/TemplateCreate
        ///// </summary>
        ///// <param name="proId"></param>
        ///// <param name="report"></param>
        ///// <returns></returns>
        //Task<Report> CreateReportAsync(string proId, Report report);

        /// <summary>
        /// 查找当前服务器里的输出模板。
        /// AchievementController/GetTemplates
        /// </summary>
        /// <param name="proId"></param>
        /// <param name="templateType"></param>
        /// <returns></returns>
        //Task<List<Report>> GetTemplatesAsync(string proId, string templateType);

        #endregion
    }
}
